Export symbols needed by Android drivers
authorBen Hutchings <ben@decadent.org.uk>
Mon, 7 Sep 2020 01:51:53 +0000 (02:51 +0100)
committerSalvatore Bonaccorso <carnil@debian.org>
Thu, 31 Aug 2023 20:24:51 +0000 (21:24 +0100)
Bug-Debian: https://bugs.debian.org/901492

We want to enable use of the Android ashmem and binder drivers to
support Anbox, but they should not be built-in as that would waste
resources and increase security attack surface on systems that don't
need them.

Export the currently un-exported symbols they depend on.

Gbp-Pq: Topic debian
Gbp-Pq: Name export-symbols-needed-by-android-drivers.patch

fs/file.c
kernel/sched/core.c
kernel/sched/wait.c
kernel/task_work.c
mm/memory.c
mm/shmem.c
security/security.c

index dbca26ef7a01a5316f0878c823915bbff130b2b5..bcc7df19ba9c7fdd5619b8ea1a443d879aa91759 100644 (file)
--- a/fs/file.c
+++ b/fs/file.c
@@ -814,6 +814,7 @@ struct file *close_fd_get_file(unsigned int fd)
 
        return file;
 }
+EXPORT_SYMBOL_GPL(close_fd_get_file);
 
 void do_close_on_exec(struct files_struct *files)
 {
index 90005760003f19a1d4ab64d05aa0dc202295a32b..80991ea93de02da844d036b290bbd4ce653bed1f 100644 (file)
@@ -7227,6 +7227,7 @@ static bool is_nice_reduction(const struct task_struct *p, const int nice)
 
        return (nice_rlim <= task_rlimit(p, RLIMIT_NICE));
 }
+EXPORT_SYMBOL_GPL(can_nice);
 
 /*
  * can_nice - check if a task can reduce its nice value
index 133b74730738bef2c412d6b270fddb3944b4b22c..a2a3381ede737c9693c7286e2f36a83d2e1f41bf 100644 (file)
@@ -247,6 +247,7 @@ void __wake_up_pollfree(struct wait_queue_head *wq_head)
        /* POLLFREE must have cleared the queue. */
        WARN_ON_ONCE(waitqueue_active(wq_head));
 }
+EXPORT_SYMBOL_GPL(__wake_up_pollfree);
 
 /*
  * Note: we use "set_current_state()" _after_ the wait-queue add,
index 065e1ef8fc8d72e55c66000b7b25f9ba0189db45..7d06ea82a53e493bdb70d5142701caa65740e1e0 100644 (file)
@@ -73,6 +73,7 @@ int task_work_add(struct task_struct *task, struct callback_head *work,
 
        return 0;
 }
+EXPORT_SYMBOL_GPL(task_work_add);
 
 /**
  * task_work_cancel_match - cancel a pending work added by task_work_add()
index 402ee697698e66a92eb4be1066b8468355493067..825882f6a98d3d5774291c6f794bbe4af9bb6b41 100644 (file)
@@ -1755,6 +1755,7 @@ void zap_page_range_single(struct vm_area_struct *vma, unsigned long address,
        mmu_notifier_invalidate_range_end(&range);
        tlb_finish_mmu(&tlb);
 }
+EXPORT_SYMBOL_GPL(zap_page_range_single);
 
 /**
  * zap_vma_ptes - remove ptes mapping the vma
index fe208a072e59492000ea931201936caa9166a7af..640bd6c81ad8f98c180e388aac022ccdbd6c0ce8 100644 (file)
@@ -4353,6 +4353,7 @@ int shmem_zero_setup(struct vm_area_struct *vma)
 
        return 0;
 }
+EXPORT_SYMBOL_GPL(shmem_zero_setup);
 
 /**
  * shmem_read_folio_gfp - read into page cache, using specified page allocation flags.
index d5ff7ff45b776d6a352e2fd1fa7e2c79d1602e56..79cc02ff59716e7b3208320ee943135ee289ed45 100644 (file)
@@ -798,6 +798,7 @@ int security_binder_set_context_mgr(const struct cred *mgr)
 {
        return call_int_hook(binder_set_context_mgr, 0, mgr);
 }
+EXPORT_SYMBOL_GPL(security_binder_set_context_mgr);
 
 /**
  * security_binder_transaction() - Check if a binder transaction is allowed
@@ -813,6 +814,7 @@ int security_binder_transaction(const struct cred *from,
 {
        return call_int_hook(binder_transaction, 0, from, to);
 }
+EXPORT_SYMBOL_GPL(security_binder_transaction);
 
 /**
  * security_binder_transfer_binder() - Check if a binder transfer is allowed
@@ -828,6 +830,7 @@ int security_binder_transfer_binder(const struct cred *from,
 {
        return call_int_hook(binder_transfer_binder, 0, from, to);
 }
+EXPORT_SYMBOL_GPL(security_binder_transfer_binder);
 
 /**
  * security_binder_transfer_file() - Check if a binder file xfer is allowed
@@ -844,6 +847,7 @@ int security_binder_transfer_file(const struct cred *from,
 {
        return call_int_hook(binder_transfer_file, 0, from, to, file);
 }
+EXPORT_SYMBOL_GPL(security_binder_transfer_file);
 
 /**
  * security_ptrace_access_check() - Check if tracing is allowed